<%@page language="java" contentType="text/html; charset=utf-8"%>
<%@include file="/commons/inc.jsp" %>

<h3 id="navTitleId">伴随及并发症情况</h3>

<script>
function show(){
	var a = '<s:property value='contResult.shenjin'/>';
	if(a!=null && a!=''){
		a = a.split(",");
		for(var i=0;i<a.length;i++){
			$('sj'+a[i].trim()).checked = true;
		}
	}
}
function show2(){
	var a = '<s:property value='contResult.xuezhitype'/>';
	if(a!=null && a!=''){
		a = a.split(",");
		if(a[0]==0){
			$('xuezhi').checked=false;
			$('zza').value = 0;
			$('zza').disabled = true;
		}else if(0<a[0]<=3){
			$('xuezhi').checked=true;
			$('zza').disabled = false;
			$('zza').value = a[0];
		}
		if(a[1]==1){
			$('zzb').checked=true;		
		}else{
			$('zzb').checked=false;
		}
	}
}
function show3(){
	var a = '<s:property value='contResult.ganyan'/>';
	if(a!=null && a!=''){
		a = a.split(",");
		for(var i=0;i<a.length;i++){
			$('gy'+a[i].trim()).checked = true;
		}		 
		$('contResult.ganyanother').disabled = !$('gy3').checked;
	}else{
		$('contResult.ganyanother').disabled = true;
	}
	
}
function display(){
	var ids = '<s:property value='contResult.concurrentids'/>';
	var times = '<s:property value='contResult.diagtimes'/>';
	
	if(ids!=null && ids!=''){
		ids = ids.split(",");
		times = times.split(",");
		for(var i=0;i<ids.length;i++){
			$('diaid-'+ids[i].trim()).checked = true;
			if($('diatime-'+ids[i].trim())){
				$('diatime-'+ids[i].trim()).disabled=false;
				$('diatime-'+ids[i].trim()).value = times[i].trim();
			}

			switch(ids[i]){
				case '1': $('contResult.tnbtype').disabled=false;break; 
				case '10': $('contResult.xgnfenji').disabled=false;break; 
				case '13': $('contResult.tnbxsb').disabled=false;break; 
				case '14': $('contResult.sgnbq').disabled=false;break;  
				case '15': $('contResult.tnbswmb').disabled=false;$('contResult.tnbswmbb').disabled=false;break; 
				case '18': $('contResult.tnbxzb').disabled=false;break; 
				case '19': for(var m=1;m<6;m++) $('sj'+m).disabled=false; show(); break; 
				case '20': $('xuezhi').disabled=false; $('zzb').disabled=false; show2();break; 
				case '23': $('contResult.guzhe').disabled=false; break; 
				case '24': $('gy1').disabled=false;$('gy2').disabled=false;$('gy3').disabled=false;show3();break; 
				case '31': $('contResult.zhongliu').disabled=false; break; 
				case '32': $('contResult.qita').disabled=false; break; 
				default: break;
			}	
		}
	}
}

function showtips(tips,flag){ 
	var tip=document.getElementById(tips);
	if(tip.style.display=="none"){ 
	        tip.style.display="inline";
	}else{ 
	      tip.style.display= "none"; 
	} 
} 
</script>

<body id="body">

<%@include file="/commons/showmessage.jsp" %>

<form name="conform" id="conform" method="post" action="${contextPath}/concurrent/concurrent.action?method=saveEditConcurrent">
	<s:hidden name="contResult.seqid" id="contResult.seqid"></s:hidden>
	<s:hidden name="contResult.patientid" id="contResult.patientid"></s:hidden>
	<s:hidden name="patientid" id="patientid"></s:hidden>
	<s:hidden name="concurrentids" id="concurrentids"></s:hidden>
	<s:hidden name="diagtimes" id="diagtimes"></s:hidden>
    <s:hidden name="xuezhitype" id="xuezhitype"></s:hidden>
    <s:hidden name="xuezhitype" id="xuezhitype"></s:hidden>
    
	<table>
    	<tr>
			<td><input type="reset" value="重置">
			<input type="button" onclick="saveEdit('save');" value="保存"></td>
		</tr>
	</table>
	
	<table border="0" cellspacing="1" cellpadding="0" class="formTable" width="100%" >
      <thead>
        <tr>
          <td width="50" align="center" class="form-th">病名</td>
          <td width="90"  align="center" class="form-th"></td>
		  <td width="60" align="center" class="form-th">确诊时间</td>
        </tr>
      </thead>
      
      <tbody> 
      
      <s:iterator value="concurrents" id="ind" status="st">
      <s:if test="confatherid==0">
		<s:set name="parentId" value="#ind.seqid"/>		  
      	<s:if test="conname.trim()=='糖尿病'">
      		<tr>
	         <td align="left" class="form-td"><input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font>
	         <br><a onclick="showtips('3-1',1);">【糖尿病诊断标准（1999年WHO）】
			<br><img id='3-1' style="display:none" src="../images/tips/3-1.png" />
			</a>	         
	         <br /><a onclick="showtips('3-2',1);">【妊娠糖尿病诊断标准】
	         <br><img id='3-2' style="display:none" src="../images/tips/3-2.png" />
	         </a>
	         </td>
	         <td align="left" class="form-td">分型：
	         <br><a onclick="showtips('4',1);">【糖尿病分型（1999年WHO）】
			<br><img id='4' style="display:none" src="../images/tips/4.png" />
	         </a><br>
	         	<select name="contResult.tnbtype" id="contResult.tnbtype" disabled="true" onchange="javascript:sel();">
	         		<option value="0" <s:if test="contResult.tnbtype == 0">selected</s:if>>请选择</option>
	         		<option value="1" <s:if test="contResult.tnbtype == 1">selected</s:if>>1型</option>
					<option value="2" <s:if test="contResult.tnbtype == 2">selected</s:if>>2型</option>
					<option value="3" <s:if test="contResult.tnbtype == 3">selected</s:if>>妊娠糖尿病</option>
					<option value="4" <s:if test="contResult.tnbtype == 4">selected</s:if>>其他特殊类型</option>
	         	</select>
	         	<input type="text" name="contResult.tnbother" <s:if test="contResult.tnbtype!=4">disabled="disabled"</s:if> id="contResult.tnbother" value="${contResult.tnbother}"/></td>
	         <td align="left" class="form-td"><input type="text"  disabled="true" class="Wdate" size="25" onClick="WdatePicker()" name="diatime" id="diatime-${seqid}"/></td>
			</tr>
       </s:if>
       
       <s:elseif test="conname.trim()=='心力衰竭'">
       		 <tr>
		         <td align="left" class="form-td"><input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font>
		         <br><a onclick="showtips('6',1);">【说明】
			<br><img id='6' style="display:none" src="../images/tips/6.png" />
	         </a>
		         </td>
		         <td align="left" class="form-td">心功能分级：
		         	<select name="contResult.xgnfenji" id="contResult.xgnfenji" disabled="true">
		         		<option value="0" <s:if test="contResult.xgnfenji == 0">selected</s:if>>请选择</option>
		         		<option value="1" <s:if test="contResult.xgnfenji == 1">selected</s:if>>I级</option>
						<option value="2" <s:if test="contResult.xgnfenji == 2">selected</s:if>>II级</option>
						<option value="3" <s:if test="contResult.xgnfenji == 3">selected</s:if>>III级</option>
						<option value="4" <s:if test="contResult.xgnfenji == 4">selected</s:if>>IV级</option>
		         	</select></td>
		         <td align="left" class="form-td"><input type="text" disabled="true" class="Wdate" size="25" onClick="WdatePicker()" name="diatime" id="diatime-${seqid}"/></td>
       		</tr>
       </s:elseif>
       
       <s:elseif test="conname.trim()=='糖尿病性肾病'">
		<tr>
         <td align="left" class="form-td"><input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font>
         <br><a onclick="showtips('7',1);">【说明】
			<br><img id='7' style="display:none" src="../images/tips/7.png" />
	         </a>
         </td>
         <td align="left" class="form-td">分期：
         	<select name="contResult.tnbxsb" id="contResult.tnbxsb" disabled="true">
         		<option value="0" <s:if test="contResult.tnbxsb == 0">selected</s:if>>请选择</option>
         		<option value="1" <s:if test="contResult.tnbxsb == 1">selected</s:if>>I级</option>
				<option value="2" <s:if test="contResult.tnbxsb == 2">selected</s:if>>II级</option>
				<option value="3" <s:if test="contResult.tnbxsb == 3">selected</s:if>>III级</option>
				<option value="4" <s:if test="contResult.tnbxsb == 4">selected</s:if>>IV级</option>
				<option value="5" <s:if test="contResult.tnbxsb == 5">selected</s:if>>V级</option>
         	</select></td>
         <td align="left" class="form-td"><input type="text" disabled="true" class="Wdate" size="25" onClick="WdatePicker()" name="diatime" id="diatime-${seqid}"/></td>
		</tr>
       </s:elseif>
       
       <s:elseif test="conname.trim()=='肾功能不全'">
       	  <tr>
	         <td align="left" class="form-td"><input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font>
	         <br><a onclick="showtips('8',1);">【说明】
			<br><img id='8' style="display:none" src="../images/tips/8.png" />
	         </a>
	         </td>
	         <td align="left" class="form-td">分期：
	         	<select name="contResult.sgnbq" id="contResult.sgnbq" disabled="true">
	         		<option value="0" <s:if test="contResult.sgnbq == 0">selected</s:if>>请选择</option>
	         		<option value="1" <s:if test="contResult.sgnbq == 1">selected</s:if>>一期</option>
					<option value="2" <s:if test="contResult.sgnbq == 2">selected</s:if>>二期</option>
					<option value="3" <s:if test="contResult.sgnbq == 3">selected</s:if>>三期</option>
					<option value="4" <s:if test="contResult.sgnbq == 4">selected</s:if>>四期</option>
	         	</select></td>
	         <td align="left" class="form-td"><input type="text" disabled="true" class="Wdate" size="25" onClick="WdatePicker()" name="diatime" id="diatime-${seqid}"/></td>
		</tr>
       </s:elseif>
       
       <s:elseif test="conname.trim()=='糖尿病性视网膜病'">
       	 <tr>
	         <td align="left" class="form-td"><input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font>
	         <br><a onclick="showtips('9',1)">【分期说明】
	    	 <br><img id='9' style="display:none" src="../images/tips/9.png" />
	    	 </a>
	         </td>
	         <td align="left" class="form-td">
	         	非增值性：<select name="contResult.tnbswmb" id="contResult.tnbswmb" disabled="true">
	         		<option value="0" <s:if test="contResult.tnbswmb == 0">selected</s:if>>请选择</option>
	         		<option value="1" <s:if test="contResult.tnbswmb == 1">selected</s:if>>I期+</option>
					<option value="2" <s:if test="contResult.tnbswmb == 2">selected</s:if>>I期++</option>
					<option value="3" <s:if test="contResult.tnbswmb == 3">selected</s:if>>II期+</option>
					<option value="4" <s:if test="contResult.tnbswmb == 4">selected</s:if>>II期++</option>
					<option value="5" <s:if test="contResult.tnbswmb == 5">selected</s:if>>III期+</option>
					<option value="6" <s:if test="contResult.tnbswmb == 6">selected</s:if>>III期++</option>
	         	</select>
	         	增值性：<select name="contResult.tnbswmbb" id="contResult.tnbswmbb" disabled="true">
	         		<option value="0" <s:if test="contResult.tnbswmbb == 0">selected</s:if>>请选择</option>
	         		<option value="1" <s:if test="contResult.tnbswmbb == 1">selected</s:if>>IV</option>
					<option value="2" <s:if test="contResult.tnbswmbb == 2">selected</s:if>>V</option>
					<option value="3" <s:if test="contResult.tnbswmbb == 3">selected</s:if>>VI</option>
	         	</select></td>
	         <td align="left" class="form-td"><input type="text" disabled="true" class="Wdate" size="25" onClick="WdatePicker()" name="diatime" id="diatime-${seqid}"/></td>
       </tr>
       </s:elseif>
       
       <s:elseif test="conname.trim()=='糖尿病性足病'">
       	 <tr>
	         <td align="left" class="form-td"><input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font>
	         <br><a onclick="showtips('10',1)">【分期说明】
	    	 <br><img id='10' style="display:none" src="../images/tips/10.png" />
	    	 </a>
	         </td>
	         <td align="left" class="form-td">Wagner分级：
	         	<select name="contResult.tnbxzb" id="contResult.tnbxzb" disabled="true">
	         		<option value="0" <s:if test="contResult.tnbxzb == 0">selected</s:if>>请选择</option>
	         		<option value="1" <s:if test="contResult.tnbxzb == 1">selected</s:if>>0级</option>
					<option value="2" <s:if test="contResult.tnbxzb == 2">selected</s:if>>1级</option>
					<option value="3" <s:if test="contResult.tnbxzb == 3">selected</s:if>>2级</option>
					<option value="4" <s:if test="contResult.tnbxzb == 4">selected</s:if>>3级</option>
					<option value="5" <s:if test="contResult.tnbxzb == 5">selected</s:if>>4级</option>
					<option value="6" <s:if test="contResult.tnbxzb == 6">selected</s:if>>5级</option>
	         	</select></td>
	         <td align="left" class="form-td"><input type="text" disabled="true" class="Wdate" size="25" onClick="WdatePicker()" name="diatime" id="diatime-${seqid}"/></td>
       </tr>
       </s:elseif>
       
       <s:elseif test="conname.trim()=='神经病变'">
		<tr>
	         <td align="left" class="form-td"><input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font></td>
	         <td align="left" class="form-td">
	         		<input type="checkbox" name="contResult.shenjin" disabled="true" value="1" id="sj1"/><font style="vertical-align:bottom;">感觉障碍(感觉减退或过敏)</font>
				 	<input type="checkbox" name="contResult.shenjin" disabled="true" value="2" id="sj2"/><font style="vertical-align:bottom;">安静时心动过速</font>
				 	<input type="checkbox" name="contResult.shenjin" disabled="true" value="3" id="sj3"/><font style="vertical-align:bottom;">固定心率</font>
				 	<input type="checkbox" name="contResult.shenjin" disabled="true" value="4" id="sj4"/><font style="vertical-align:bottom;">直立性低血压</font>
				 	<input type="checkbox" name="contResult.shenjin" disabled="true" value="5" id="sj5"/><font style="vertical-align:bottom;">排汗异常</font>
			</td>
	         <td align="left" class="form-td"></td>
       </tr>
       </s:elseif>
       
       <s:elseif test="conname.trim()=='血脂异常'">
		<tr>
         <td align="left" class="form-td"><input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font>
         <br><a onclick="showtips('11',1)">【分期说明】
    	 <br><img id='11' style="display:none" src="../images/tips/11.png" />
    	 </a>
         </td>
         <td align="left" class="form-td">
 			<input type="checkbox" name="xuezhi" id="xuezhi" disabled="disabled" value="1" onclick="zza.disabled=!this.checked;if (!this.checked) zza.value='0'"/>
				<select name="zza" id="zza" disabled="disabled">
	         		<option value="0" <s:if test="zza == 0">selected</s:if>>请选择</option>
	         		<option value="1" <s:if test="zza == 1">selected</s:if>>高胆固醇血症</option>
					<option value="2" <s:if test="zza == 2">selected</s:if>>高甘油三酯血症</option>
					<option value="3" <s:if test="zza == 3">selected</s:if>>混合型高脂血症</option>
         		</select>
			<input type="checkbox" name="zzb" id="zzb" disabled="disabled" value="1" onclick="if(!this.checked) zzb.value='0'"/><font style="vertical-align:sub;">低高密度脂蛋白血症</font>
			</td>
         <td align="left" class="form-td"><input type="text" disabled="disabled" class="Wdate" size="25" onClick="WdatePicker()" name="diatime" id="diatime-${seqid}"/></td>
       </tr>
       </s:elseif>
       
       <s:elseif test="conname.trim()=='骨折'">
		<tr>
	         <td align="left" class="form-td"><input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font></td>
	         <td align="left" class="form-td">部位:<input type="text" name="contResult.guzhe" id="contResult.guzhe" disabled="true" value="${contResult.guzhe}"/>
	         <!-- <a href="javascript:;" onclick="addTable('addtb','groupbh','groupname')">增加</a> --></td>
	         <td align="left" class="form-td"><input type="text" disabled="disabled" class="Wdate" size="25" onClick="WdatePicker()" name="diatime" id="diatime-${seqid}"/></td>
       </tr>
       </s:elseif>
       
       <s:elseif test="conname.trim()=='病毒性肝炎'">
         <tr>
	         <td align="left" class="form-td"><input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font></td>
	         <td align="left" class="form-td"><font style="vertical-align:sub;">类型:</font>
	         		<input type="checkbox" name="contResult.ganyan" value="1" id="gy1" disabled="disabled"/><font style="vertical-align:sub;">乙肝</font>
				 	<input type="checkbox" name="contResult.ganyan" value="2" id="gy2" disabled="disabled"/><font style="vertical-align:sub;">丙肝</font>
				 	<input type="checkbox" name="contResult.ganyan" value="3" id="gy3" onclick="javascript:ganyan(this);" disabled="disabled"/><font style="vertical-align:sub;">其他：</font>
				 	<input type="text" disabled="disabled" name="contResult.ganyanother" id="contResult.ganyanother" value="${contResult.ganyanother}"/>
				 	 </td>
	         <td align="left" class="form-td"><input type="text" disabled="true" class="Wdate" size="25" onClick="WdatePicker()" name="diatime" id="diatime-${seqid}"/></td>
		</tr>
       </s:elseif>
       
       <s:elseif test="conname.trim()=='肿瘤'">
       	 <tr>
	         <td align="left" class="form-td"><input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font></td>
	         <td align="left" class="form-td"><input type="text" disabled="true" name="contResult.zhongliu" id="contResult.zhongliu" value="${contResult.zhongliu}"/></td>
	         <td align="left" class="form-td"><input type="text" disabled="true" class="Wdate" size="25" onClick="WdatePicker()" name="diatime" id="diatime-${seqid}"/></td>
       </tr>
       </s:elseif>
        
       <s:elseif test="conname.trim()=='其他'">
          <tr>
	         <td align="left" class="form-td"><input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font></td>
	         <td align="left" class="form-td"><input type="text" disabled="true" name="contResult.qita" id="contResult.qita" value="${contResult.qita}"/></td>
	         <td align="left" class="form-td"><input type="text" disabled="true" class="Wdate" size="25" onClick="WdatePicker()" name="diatime" id="diatime-${seqid}"/></td>
       	  </tr>
       </s:elseif>
       
       <s:elseif test="conname.trim()=='高尿酸血症/痛风'">
          <tr>
			<td align="left" class="form-td"><input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font>
			<br><a onclick="showtips('12',1)">【分期说明】
	    	<br><img id='12' style="display:none" src="../images/tips/12.png" />
	    	 </a>
			</td>
			<td align="left" class="form-td"></td>
			<td align="left" class="form-td"><input type="text"  disabled="true" class="Wdate" size="25" onClick="WdatePicker()" name="diatime" id="diatime-${seqid}"/></td>
		  </tr>
       </s:elseif>
       
       <s:else>
		  <tr>
			<td align="left" class="form-td"><input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font></td>
			<td align="left" class="form-td"></td>
			<td align="left" class="form-td"><input type="text"  disabled="true" class="Wdate" size="25" onClick="WdatePicker()" name="diatime" id="diatime-${seqid}"/></td>
		  </tr>
       </s:else>
       
        <s:iterator value="concurrents" id="in" status="inst">        
	      <s:if test="confatherid > 0 && confatherid==#parentId">
		      <tr>
				<td align="left" class="form-td">&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="diaid" id="diaid-${seqid}" value="${seqid}" onclick="javascript:selDis(this,${seqid});" /><font style="vertical-align:bottom;">${conname}</font>
				<s:if test="conname.trim()=='低血糖症'">
		 		<br><a onclick="showtips('5',1)">【分类说明】
		    	 <br><img id='5' style="display:none" src="../images/tips/5.png" />
		    	 </a>
      			 </s:if>
				</td>
				<td align="left" class="form-td"></td>
				<td align="left" class="form-td"><input type="text"  disabled="true" class="Wdate" size="25" onClick="WdatePicker()" name="diatime" id="diatime-${seqid}"/></td>
			  </tr>
	      </s:if>
        </s:iterator>  
        </s:if>
      </s:iterator>  
      <script>display()</script>
  	</tbody>
    </table>
    
    <table>
    	<tr>
			<td> 
			<input type="reset" value="重置">
		    <input type="button" onclick="saveEdit('save');" value="保存"></td>
		</tr>
	</table>
</form>

<%@include file="/commons/tableSel.jsp" %>

</body>

<style type="text/css">
body {
	height: 100%;
	width: 100%;
}
</style>

<script>
function saveEdit(type){
	if(type=='refresh'){
		location.reload();
	}else if(type=='save'){
		if(!Validator.Validate($('conform'),3)){
			return;
		} 
		var s = document.getElementsByName('diaid');
		var ids = "";
		var times = "";
		var xz = "";
		
		if(s){
			for(var i=0;i<s.length;i++){
				if(s[i].checked){
					var id = s[i].value;
					if($('diatime-'+id) && $('diatime-'+id)!=''){
						times += $('diatime-'+id).value + ",";
					}else{
						times += " ,";
					}				
					ids += id +",";
				}
			}
		}
		if(ids!=""){
			ids = ids.substring(0,ids.length-1);
		}
		if(times!=""){
			times = times.substring(0,times.length-1);
		}
		if($('xuezhi').checked){
			var zz = $('zza');
			if(zz){
				xz += zz.options[zz.selectedIndex].value+",";
			}		
		}else{
			xz += "0,";
		}	  
		xz += $('zzb').checked? "1":"0";
		$('conform').concurrentids.value= ids;
		$('conform').diagtimes.value= times;
		$('conform').xuezhitype.value= xz;
		$('conform').submit();
	}
} 

function sel(){
	if($('contResult.tnbtype').value==4){
		$('contResult.tnbother').disabled=false;
	}else{
		$('contResult.tnbother').disabled=true;
	}
}
function ganyan(obj){
	$('contResult.ganyanother').disabled = !obj.checked;
	if (!obj.checked){
		 $('contResult.ganyanother').value='';
	}
}
function selDis(obj,id){
	if($('diatime-'+id)){
		$('diatime-'+id).disabled = !obj.checked; 
		if(!obj.checked){
			$('diatime-'+id).value = "";
		}
	}
	
	switch(id){
		case 1: 
			$('contResult.tnbtype').disabled=!obj.checked;
			if(!obj.checked){
				$('contResult.tnbtype').options[0].selected = true;
				$('contResult.tnbother').value="";
			}	
			break; 
		case 10: 
			$('contResult.xgnfenji').disabled=!obj.checked;
			if(!obj.checked){$('contResult.xgnfenji').options[0].selected = true;}
			break; 
		case 13: 
			$('contResult.tnbxsb').disabled=!obj.checked;
			if(!obj.checked){$('contResult.tnbxsb').options[0].selected = true;}
			break; 
		case 14: 
			$('contResult.sgnbq').disabled=!obj.checked;
			if(!obj.checked){$('contResult.sgnbq').options[0].selected = true;}
			break;  
		case 15: 
			$('contResult.tnbswmb').disabled=!obj.checked;
			$('contResult.tnbswmbb').disabled=!obj.checked;
			if(!obj.checked){
				$('contResult.tnbswmb').options[0].selected = true;
				$('contResult.tnbswmbb').options[0].selected = true;
			}
			break; 
		case 18: 
			$('contResult.tnbxzb').disabled=!obj.checked;
			if(!obj.checked){$('contResult.tnbxzb').options[0].selected = true;}
			break; 
		case 19:
			for(var m=1;m<6;m++){
				$('sj'+m).disabled=!obj.checked;
				if(!obj.checked){
					$('sj'+m).checked=false;
				}
			}
			break; 
		case 20: 
			$('xuezhi').disabled=!obj.checked; 
			$('zzb').disabled=!obj.checked;
			if(!obj.checked){
				$('zza').options[0].selected = true;
				$('zza').disabled = true;
				$('xuezhi').checked=false; 
				$('zzb').checked=false;
			}
			break; 
		case 23: 
			$('contResult.guzhe').disabled=!obj.checked; 
			if(!obj.checked){$('contResult.guzhe').value = "";}
			break; 
		case 24: 
			$('gy1').disabled=!obj.checked;$('gy2').disabled=!obj.checked;$('gy3').disabled=!obj.checked;
			if(!obj.checked){
				$('gy1').checked=false;
				$('gy2').checked=false;
				$('gy3').checked=false;
				$('contResult.ganyanother').value="";
			}
			break; 
		case 31: 
			$('contResult.zhongliu').disabled=!obj.checked; 
			if(!obj.checked){$('contResult.zhongliu').value = "";}
			break; 
		case 32: 
			$('contResult.qita').disabled=!obj.checked; 
			if(!obj.checked){$('contResult.qita').value = "";}
			break; 
		default: break;	
	}
}
</script>